package com.boboPlanet.dict.config;

import com.boboPlanet.dict.interceptor.LogInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

import javax.annotation.Resource;

/**
 * @Description: TODO
 * @Author: mis_wu
 * @Date: 2023/5/7
 * @Company planet
 **/
@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport {

    @Resource
    private LogInterceptor logInterceptor;

    /**
     * 注册自定义拦截器
     * @param registry InterceptorRegistry
     */
    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(logInterceptor);
    }
}
